import request from '@/utils/request'

// 查询欠费明细列表
export function listBill(query) {
  return request({
    url: '/datastatistics/bill/list',
    method: 'get',
    params: query
  })
}

// 查询欠费明细详细
export function getBill(id) {
  return request({
    url: '/datastatistics/bill/' + id,
    method: 'get'
  })
}

// 新增欠费明细
export function addBill(data) {
  return request({
    url: '/datastatistics/bill',
    method: 'post',
    data: data
  })
}

// 修改欠费明细
export function updateBill(data) {
  return request({
    url: '/datastatistics/bill',
    method: 'put',
    data: data
  })
}

// 删除欠费明细
export function delBill(id) {
  return request({
    url: '/datastatistics/bill/' + id,
    method: 'delete'
  })
}

export function checkoutBills(id) {
  return request({
    url: '/datastatistics/bill/checkout/'+id,
    method: 'get'
  })
}

// 柜台收费
export function getBillListInGtsf(query) {
  return request({
    url: '/datastatistics/bill/getBillListInGtsf',
    method: 'get',
    params: query
  })
}

// 用户离场时，同步所有水表数据
export function synchronizationWaterData(query) {
  return request({
    url: '/datastatistics/bill/synchronizationWaterData',
    method: 'get',
    params: query,
    timeout: 120000 // 单独设置 120 秒超时
  })
}
// 用户离场时，同步所有电表数据
export function synchronizationEletricityData(query) {
  return request({
    url: '/datastatistics/bill/synchronizationEletricityData',
    method: 'get',
    params: query,
    timeout: 120000 // 单独设置 120 秒超时
  })
}
// 查询用户挂接表，以及用户下公摊下的其他用户挂接表
export function getUserTerminalList(query) {
  return request({
    url: '/datastatistics/bill/getUserTerminalList',
    method: 'get',
    params: query
  })
}


// 查询用户挂接表，以及用户下公摊下的其他用户挂接表
export function getOtherTerminalList(query) {
  return request({
    url: '/datastatistics/bill/getOtherTerminalList',
    method: 'get',
    params: query
  })
}
// 查询用户挂接表，以及用户下公摊下的其他用户挂接表
export function insertBillForUseLeve(query) {
  return request({
    url: '/datastatistics/bill/insertBillForUseLeve',
    method: 'get',
    params: query,
    timeout: 360000
  })
}
//插入补录的数据
export function dealUserLeaveForinsertHistoryData(query) {
  debugger
  return request({
    url: '/datastatistics/bill/dealUserLeaveForinsertHistoryData',
    method: 'post',
    params: query
  })
}


